home *** CD-ROM | disk | FTP | other *** search
- //========================================================================================
- //
- // Exploder description for 'FWvl' (ODF view layout) resources
- //
- // Author: Steve Crutchfield
- //
- // Copyright: (c) 1996 by Apple Computer, Inc., all rights reserved.
- //
- // The EDL and VDL code describing this resource type rely heavily
- // on the use of class labels (four-character codes) used by
- // ODF's archiver. However, the base FrameLayout object is not
- // archivable and thus has no class label. In order to preserve
- // the symmetry requried by ResEdit's recursive "SELF" command,
- // a dummy class label ('root') is inserted at the top level of
- // the view hierarchy by a plug-in command.
- //
- //========================================================================================
-
- ArchivableHeader(); // custom plugin routine--adds 10 bytes including 'root' tag
- // to top level of hierarchy
-
- //----------------------------------------------------------------------------
- // The following definitions are adapted almost directly from the ODFRC
- // type definitions to which they correspond.
- //----------------------------------------------------------------------------
-
- Define(FW_RView)
- {
- Word(fObjectTag);
- Long(fObjectID);
- PadWord();
- Long(fParentViewClass);
- PadWord();
- Long(fParentViewID);
- Long(fViewID);
- Long(fLeft);
- Long(fTop);
- Long(fRight);
- Long(fBottom);
- Long(fBinding);
- }
-
- Define(FW_RSuperView)
- {
- Call(FW_RView);
-
- Long(fExtentX);
- Long(fExtentY);
- Byte(fIsContentView);
- Word(fScrollingDirection);
-
- List(fViews, View, OneBasedCount(16))
- SELF;
- }
-
- Define(FW_RArchivableObject)
- {
- Word(fClassTag);
- Long(fClassID);
- Long(fLabel);
- Word(fObjectTag);
- Long(fObjectID);
- }
-
- Define(FW_RRadioCluster)
- {
- Call(FW_RArchivableObject);
-
- PadWord();
- Long(fViewClass);
- PadWord();
- Long(fViewID);
- PadLong();
-
- List(fRadioArray, RadioEntry, OneBasedCount(16))
- Long(fRadioID);
- }
-
- Define(FW_RControl)
- {
- Call(FW_RView);
-
- Long(fMessage);
- Word(fReceiver);
- Long(fInitialValue);
- }
-
- Define(FW_RButton)
- {
- Call(FW_RControl);
-
- Long(fButtonKind);
-
- Call(FW_RFont);
- Call(FW_RStringData);
- }
-
- Define(FW_RPopupMenu)
- {
- Call(FW_RControl);
-
- Word(fMacMenuID);
- Word(fTitleWidth);
- Word(fInitialMenuItem);
- Word(fMenuVariation);
- Long(fMenuRefCon);
-
- Call(FW_RFont);
- Call(FW_RStringData);
- }
-
- Define(FW_RScrollBar)
- {
- Call(FW_RControl);
-
- Word(fMinValue);
- Word(fMaxValue);
- Long(fMajorUnits);
- Long(fMinorUnits);
- }
-
- Define(FW_RListBox)
- {
- Call(FW_RView);
-
- Word(fNumRows);
- Byte(fVerticalSB);
- Byte(fSingleSelection);
- Byte(fUseFocusFrame);
- Byte(fUseClientData);
- Long(fDblClickMessage);
-
- Call(FW_RFont);
-
- List(fStrings, String, OneBasedCount(16))
- Call(FW_RStringData);
- }
-
- Define(FW_RStaticText)
- {
- Call(FW_RView);
- Call(FW_RFont);
-
- // Comment out the next line if you're editing an ODF 1 part.
- Call(FW_RColor);
-
- Call(FW_RStringData);
- }
-
- Define(FW_REditView)
- {
- Call(FW_RView);
-
- Word(fMaxChars);
- Word(fAttributes);
-
- Call(FW_RFont);
- Call(FW_RStringData);
- }
-
- Define(FW_RPictSView)
- {
- Call(FW_RSuperView);
-
- Word(fPictureID);
- }
-
- Define(FW_RFont)
- {
- Long(fFontSize);
- Word(fFontStyle);
-
- // Using a list here is a workaround. A better solution would
- // be to use an Element(); however, there is no structure in
- // VDL which causes all identifiers within its scope to
- // apply to a sub-element rather than the containing element.
- // DynamicVList performs this task for a list, so we use a
- // single-element list here. This is needed because both
- // FW_RFont and FW_RStringData contain script and language
- // code fields, which must have the same name in each case so
- // that a single VDL named statement can be used to generate all
- // script/language code popup menus.
-
- List(fFontName, String, 1)
- {
- Word(fScriptCode);
- Word(fLanguageCode);
- String(fFontName, LengthWord);
- }
- }
-
- Define(FW_RStringData)
- {
- // Use of List is a workaround; see comment in FW_RFont, above.
-
- List(fString, String, 1)
- {
- Word(fScriptCode);
- Word(fLanguageCode);
- String(fString, LengthWord);
- }
- }
-
- Define(FW_RColor)
- {
- Word(fRed);
- Word(fGreen);
- Word(fBlue);
- }
-
- Define(FW_RScroller)
- {
- PadWord();
- Long(fEnclosureFrameClass);
- PadWord();
- Long(fEnclosureFrameID);
- Long(fAutoScrollInset);
- Long(fScrollUnitX);
- Long(fScrollUnitY);
-
- // Comment out the next line if you're editing an
- // ODF 1 part.
-
- Byte(fPageNavigationKeys);
- }
-
- Define(FW_RScrollBarScroller)
- {
- Call(FW_RScroller);
-
- // Comment out the next line if you're editing an
- // ODF 1 part.
-
- Byte(fLiveScrolling);
-
- Long(fHorizViewID);
- Long(fVertViewID);
- }
-
- //----------------------------------------------------------------------------
- // Main definition begins here.
- //----------------------------------------------------------------------------
-
- Switch(fLabel)
- {
- case 'root':
- {
- Long(fLayoutSizeX);
- Long(fLayoutSizeY);
-
- List(fViews, View, OneBasedCount(16))
- SELF; // root FrameLayout contains a list of views,
- // each of which can be of any of the types
- // present in 'case' statements below
-
- List(fScrollers, Scroller, OneBasedCount(16))
- {
- Call(FW_RArchivableObject);
-
- Switch(fLabel)
- {
- case 'sclr':
- {
- Call(FW_RScroller);
- }
-
- case 'sbsc':
- {
- Call(FW_RScrollBarScroller);
- }
- }
- }
- }
-
- // The following 'case' statements all represent
- // standard view types.
-
- case 'view':
- case 'grbx':
- {
- Call(FW_RView);
- }
-
- case 'suvw':
- case 'rulr':
- case 'drvw':
- case 'ctvw':
- {
- Call(FW_RSuperView);
- }
-
- case 'cont':
- case 'ncnt':
- {
- Call(FW_RControl);
- }
-
- case 'butn':
- {
- Call(FW_RButton);
- }
-
- case 'popm':
- {
- Call(FW_RPopupMenu);
- }
-
- case 'scbr':
- {
- Call(FW_RScrollBar);
- }
-
- case 'lbox':
- {
- Call(FW_RListBox);
- }
-
- case 'stxt':
- case 'gpbx':
- {
- Call(FW_RStaticText);
- }
-
- case 'picv':
- {
- Call(FW_RPictSView);
- }
-
- case 'edvw':
-
- // The following 'case' statements all represent
- // custom view types. 'Pwdv' doesn't extend 'edvw'
- // at all and thus shares a definition with it; the
- // other custom types extend the standard types in
- // some way. You can add your own custom types here
- // in a similar manner.
-
- case 'Pwdv':
- {
- Call(FW_REditView);
- }
-
- case 'Sedv':
- {
- Call(FW_REditView);
-
- Long(fHorizViewID);
- Long(fVertViewID);
- Long(fTextWidth);
- }
-
- case 'Frmv':
- {
- Call(FW_RPictSView);
-
- Word(fPicture2);
-
- List(fRadioClusters, RadioCluster, 3)
- Call(FW_RRadioCluster); // list of 3 radio clusters
- }
- }
-